#pragma once

#include <climits>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <list>

/* Concatenate a vector with a delim */
template <typename T> std::string strJoin(const std::string &delim, const T &vec) 
{
    std::ostringstream s;
    for (const auto &i : vec) 
    {
        if (&i != &vec[0]) 
        {
            s << delim;
        }
        s << i;
    }
    return s.str();
}


/* Get the Vector String object */
template <typename T> std::string getVectorString(std::vector<T> &list) 
{
    return "[" + strJoin(", ", list) + "]";
}

/* 打印列表 */
template <typename T> void printVector(std::vector<T> list)
{
    std::cout << getVectorString(list) << '\n';
}

/* 打印矩阵 */
template <typename T> void printVectorMatrix(std::vector<std::vector<T>> &matrix) 
{
    std::cout << "[" << '\n';
    for (std::vector<T> &list : matrix)
        std::cout << "  " + getVectorString(list) + "," << '\n';
    std::cout << "]" << '\n';
}